import {
  Entity,
  Column,
  PrimaryGeneratedColumn,
  OneToOne,
  JoinColumn,
  Relation,
} from 'typeorm'
import { User } from './User'

@Entity()
export class UserInfo {
  @PrimaryGeneratedColumn()
  id: number

  @Column()
  height: string

  @Column()
  weight: string

  @Column('int')
  age: number

  @OneToOne((type) => User, (user) => user.userInfo, {
    onDelete: 'CASCADE',
  })
  @JoinColumn()
  user: User
}
